﻿<!DOCTYPE HTML>
<!-- saved from url=(0090)http://172.13.19.31:6060/note_html/Java/JavaSE/1020010-JavaSE-DesignPattern(设计模式).html -->
<!DOCTYPE html PUBLIC "" ""><HTML><HEAD><META content="IE=11.0000" 
http-equiv="X-UA-Compatible">
 
<META http-equiv="Content-Type" content="text/html; charset=UTF-8"> 
<TITLE>JavaSE-DesignPattern(设计模式)</TITLE> <LINK href="JavaSE-DesignPattern(设计模式)_files/standalone.css" 
rel="stylesheet"> <LINK href="JavaSE-DesignPattern(设计模式)_files/overlay-apple.css" 
rel="stylesheet"> <LINK href="JavaSE-DesignPattern(设计模式)_files/article_edit.css" 
rel="stylesheet"> 
<STYLE type="text/css">
	#content{
		margin: 5px 10px;
	}
</STYLE>
	 <!-- 代码高亮 -->	 <LINK href="JavaSE-DesignPattern(设计模式)_files/shCoreEclipse.css" 
rel="stylesheet">	 <LINK href="JavaSE-DesignPattern(设计模式)_files/my-highlighter.css" 
rel="stylesheet"> 
<META name="GENERATOR" content="MSHTML 11.00.10586.545"></HEAD> 
<BODY>
<DIV id="content">
<H1 align="center">JavaSE-DesignPattern(设计模式)</H1>
<P align="right" 
style="margin: 0px 10px 0px 0px; padding: 0px;">最后修改时间：2015-09-17 22:47:32</P>
<HR style="border-width: 2px; border-color: lime;">

<H3>单例模式(Singleton)</H3>
<P style="text-indent: 0.8cm;">表示一个类只会生成唯一的一个对象 
</P><SPAN><STRONG>Singleton.java</STRONG></SPAN> <A href="http://172.13.19.31:6060/achiever/note_html/codeHelper.do?oper=show&amp;uri=/code/javase/design/Singleton.java" 
target="_blank">查看</A> <A href="http://172.13.19.31:6060/achiever/note_html/codeHelper.do?oper=down&amp;uri=/code/javase/design/Singleton.java" 
target="_blank">下载</A> 
<H3>策略模式(Strategy)</H3><SPAN><STRONG>Strategy.java</STRONG></SPAN> <A href="http://172.13.19.31:6060/achiever/note_html/codeHelper.do?oper=show&amp;uri=/code/javase/design/Strategy.java" 
target="_blank">查看</A> <A href="http://172.13.19.31:6060/achiever/note_html/codeHelper.do?oper=down&amp;uri=/code/javase/design/Strategy.java" 
target="_blank">下载</A> 
<P style="text-indent: 0.8cm;">主要是定义一系列的算法,把这些算法一个个封装成单独的类.在程序调用的时候可以选择不同的算法 
</P>
<UL>
  <LI>抽象策略角色：策略类，通常由一个接口或者抽象类实现</LI>
  <LI>具体策略角色：包装了相关的算法和行为(一个个的具体算法类)</LI>
  <LI>环境角色：持有一个策略类的引用，最终给客户端调用的。</LI></UL>
<HR style="border-width: 2px; border-color: lime;">

<DIV align="center">©copyright 版权所有   作者：zzy</DIV>
<SCRIPT src="../../pub/syntaxhighlighter/scripts/shCore.js" type="text/javascript"></SCRIPT>
 
<SCRIPT src="../../pub/syntaxhighlighter/scripts/shBrushJava.js" type="text/javascript"></SCRIPT>
	
<SCRIPT src="../../pub/syntaxhighlighter/scripts/shBrushJScript.js" type="text/javascript"></SCRIPT>
 
<SCRIPT src="../../pub/syntaxhighlighter/scripts/shBrushXml.js" type="text/javascript"></SCRIPT>
 
<SCRIPT src="../../pub/syntaxhighlighter/scripts/shBrushSql.js" type="text/javascript"></SCRIPT>
 
<SCRIPT src="../../pub/syntaxhighlighter/scripts/shBrushBash.js" type="text/javascript"></SCRIPT>
	
<SCRIPT src="../../pub/syntaxhighlighter/init.js" type="text/javascript"></SCRIPT>
 
<SCRIPT src="../../pub/js/jquery.tools.min.js" type="text/javascript"></SCRIPT>
 <!-- make all links with the 'rel' attribute open overlays --> 
<SCRIPT>
  $(function() {
      $("#apple img[rel]").overlay({effect: 'apple'});
    });
</SCRIPT>
 </DIV></BODY></HTML>
